/**
 * @description 监督举报 模块 table 组件 el-table-column 表头部分二次封装 实现自我调用多级表头
 * @pargram
 * @return
 * @auth yxj
*/
<template>
    <div class="">
        <template v-for = "(column, index) in tableLabel">
            <el-table-column
                :key = 'index'
                :label = "column.label"
                :prop = "column.prop"
                :width = "column.width ? column.width : ''"
                :fixed = "column.fixed ? column.fixed : false"
                :min-width = "column.minWidth ? column.minWidth : ''"
                :align = "column.align"
                :resizable = "tableOption.resizable || ''"
            >
                <template slot-scope = "scope">
                    <ex-slot v-if = "column.render" :render = "column.render" :row = "scope.row" :index="scope.$index"/>
                    <span v-if = "!column.render && (!column.option || column.option.length === 0)" v-text = "scope.row[column.prop]"></span>
                </template>
                <taleColumn v-if = "column.option && column.option.length !== 0" :tableLabel = "column.option"></taleColumn>
            </el-table-column>
        </template>
    </div>
</template>

<script>
// 自定义内容的组件
let exSlot = {
    functional: true,
    props: {
    row: Object,
    render: Function,
    index: Number,
    column: {
        type: Object,
        default: null
    }
    },
    render: (h, data) => {
    const params = {
        row: data.props.row,
        index: data.props.index
    }
    if (data.props.column) params.column = data.props.column
    return data.props.render(h, params)
    }
}
export default {
    components : {
        taleColumn :() => import('./tableColumn'),
        exSlot
    },
    props: {
        tableLabel: {
            type: Array,
            default () {
                return []
            }
        },
    },
    data () {
        return {
            
        }
    }

}
</script>

<style>

</style>